package com.topcheer.gateway.ribbon.context;

import com.google.common.collect.Maps;

import java.util.Collections;
import java.util.Map;

/**
 * @author xutao
 * @Package com.topcheer.gateway.context
 * @Description: ${todo}
 * @date 2020/9/25 14:06
 */
public class RibbonFilterContext {

    public static final Map<String, String> contextMap = Maps.newHashMap();

    public RibbonFilterContext put(String key, String value) {
        contextMap.put(key, value);
        return this;
    }

    public String get(String key) {
        return contextMap.get(key);
    }

    public RibbonFilterContext remove(String key) {
        contextMap.remove(key);
        return this;
    }

    public Map<String, String> getContextMap() {
        return Collections.unmodifiableMap(contextMap);
    }
}
